<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="d1"><h1>kang</h1></div>
		<script>
			var d1=document.getElementById("d1");
			var d2=document.getElementsByTagName("div")[0];
			//获取标签里的内容
			//alert(d1.innerText);
			//alert(d1.innerHTML);
			// d1.innerHTML="tangweikang";
			// d1.innerText="tangweikang233";
			
			 d1.innerHTML="<h2>kang</h2>";
			 //d1.innerText="<h2>kang</h2>";
			//alert(d1.innerText);
			//alert(d1.innerHTML);
			
		</script>
	</body>
</html>
